package com.woniu.mapper;

import com.woniu.pojo.Video;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.vo.VideoVO;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 课程视频 Mapper 接口
 * </p>
 *
 * @author xiaoruan
 * @since 2023-03-15
 */
public interface VideoMapper extends BaseMapper<Video> {

    @Select("select id,title from wnxt_video where chapter_id=#{id}")
    @ResultType(VideoVO.class)
    List<VideoVO> findVideoByChapterId(String id);

    @Select("select * from wnxt_video where course_id=#{courseId}")
    List<Video> getVideosByCourseId(String courseId);
}
